package lab_07.com.acme;


public class Test {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int v1 = 3;
		byte v2 = (byte) v1; //need to cast to byte as int is not automatically promoted to byte.
		System.out.println(v2);
		v1 = 256;
		byte v3 = (byte) v1; // v1 is 100000000 in binary, so v3 is 00000000 (as it's only 8 bits)
		System.out.println(v3);
		int v4 = 's'; // char 's' is promoted to int
		System.out.println(v4);
		
		byte v5 = 115;
		if (v5 == 's') { //they both are promoted to int
			System.out.println("Equals");
		}
		
		// 4.0
		System.out.println((double)4);
		
		// 6.0
		double d = 5;
		System.out.println(d + 1);
		
		@SuppressWarnings("unused")
		boolean b = v4==0; //int isn't boolean in Java (like in C), so we need to manually compare it with 0 to get boolean value
		
		@SuppressWarnings("unused")
		String v6 = "short";
		
		float v7 = 3.67f; //3.67 is double, and double can't be promoted to fload, so we need to manually specify float literal
		
		@SuppressWarnings("unused")
		float v9 = 3;// 3, which is int, is promoted to float 
		
		@SuppressWarnings("unused")
		int v8 = (int) v7; //need to cast
		
		@SuppressWarnings("unused")
		int array[] = new int [] {27};
		
		
	}
}
